<?php

namespace app\api\controller;

use app\api\model\Banner;
use app\api\model\Cate;
use app\api\model\HitHotel;
use app\api\model\HitScenic;
use app\api\model\Hotel;
use app\api\model\HotelCate;
use app\api\model\Notice;
use app\api\model\QuickLink;
use app\api\model\Scenic;
use ba\Tree;
use Throwable;
use think\facade\Db;
use think\facade\Config;
use app\common\controller\Frontend;
use app\common\library\token\TokenExpirationException;

class Index extends Frontend
{
    protected array $noNeedLogin = ['*'];

    public function initialize(): void
    {
        parent::initialize();
    }

    /**
     * 获取bannner
     * @throws Throwable
     */
    public function getBanner(){
        return json((new Banner())->getBanner());
    }

    /**
     * 获取金刚区
     * @throws Throwable
     */
    public function getQuickLink(){
        return json((new QuickLink())->getQuickLink());
    }



    /**
     * 获取热门景区列表
     * @throws Throwable
     */
    public function getRmScenic(){
        return json((new HitScenic())->getRmScenic($this->request_array));
    }



    /**
     * 获取周边景区列表
     * @throws Throwable
     */
    public function getRdScenic(){
        return json((new Scenic())->getRdScenic($this->request_array));
    }



    /**
     * 获取热门民宿列表
     * @throws Throwable
     */
    public function getRmHotel(){
        return json((new HitHotel())->getRmHotel($this->request_array));
    }


    /**
     * 获取全部景区列表
     * @throws Throwable
     */
    public function getAllScenic(){
        return json((new Scenic())->getAllScenic($this->request_array));
    }


    /**
     * 获取全部民宿列表
     * @throws Throwable
     */
    public function getAllHotel(){
        return json((new Hotel())->getAllHotel($this->request_array));
    }




    /**
     * 获取景点详情
     * @throws Throwable
     */
    public function scenicDetail(){
        return json((new Scenic())->scenicDetail($this->request_array));
    }


    /**
     * 获取民宿详情
     * @throws Throwable
     */
    public function hotelDetail(){
        return json((new Hotel())->hotelDetail($this->request_array));
    }

    /**
     * 获取公告列表
     * @throws Throwable
     */
    public function getNotice(){
        return json((new Notice())->getNotice($this->request_array));
    }


    /**
     * 公告已读
     * @throws Throwable
     */
    public function readNotice(){
        return json((new Notice())->readNotice($this->request_array));
    }



    /**
     * 获取景点分类
     * @throws Throwable
     */
    public function getScenicCate(){
        return json((new Cate())->getScenicCate());
    }


    /**
     * 获取民宿分类
     * @throws Throwable
     */
    public function getHotelCate(){
        return json((new HotelCate())->getHotelCate());
    }



}